#include "HiranipraShared.h"

#include "HCM/IComponent.h"
#include "HCM/ComponentFactory.h"
#include "Platform/IO/IFileStream.h"

#ifndef _SHARED_PLATFORM_IO_IFILESYSTEM_H_
#define _SHARED_PLATFORM_IO_IFILESYSTEM_H_

namespace Hiranipra {
	namespace Platform {
		namespace IO {

			class IFileSystem : implements IComponent
			{
			public:
				virtual ~IFileSystem(){}

				virtual const wstring GetSeparator() const = 0;

				virtual void Setup( const wstring& appPath ) = 0;

				virtual vector<wstring> GetSearchPaths() const = 0;
				virtual void AddSearchPath( const wstring& path, bool insertAtHead = false ) = 0;
				virtual void RemoveSearchPath( const wstring& path ) = 0;

				virtual const wstring GetWritePath() const = 0;
				virtual void SetWritePath( const wstring& writePath ) = 0;

				virtual bool MakeDirectory( const wstring& path ) = 0;
				virtual bool Delete( const wstring& path ) = 0;

				virtual IFileStream* OpenRead( const wstring& path ) = 0;
				virtual IFileStream* OpenWrite( const wstring& path ) = 0;
				virtual IFileStream* OpenAppend( const wstring& path ) = 0;

				virtual bool Exists( const wstring& path ) = 0;
				virtual bool IsDirectory( const wstring& path ) = 0;
				virtual bool IsSymbolicLink( const wstring& path ) = 0;
				virtual int64 GetLastModifiedTime( const wstring& path ) = 0;

				virtual vector<wstring> EnumerateFiles( const wstring& path ) = 0;
				virtual vector<wstring> EnumerateFiles( const wstring& path, const wstring& wildcard, bool caseSensitive ) = 0;
			};

			// {798E0614-45F4-4601-AF8C-BCFE8A82B009}
			DECLARE_COMPONENT_TYPE( IFileSystem ) = { 0x798e0614, 0x45f4, 0x4601, { 0xaf, 0x8c, 0xbc, 0xfe, 0x8a, 0x82, 0xb0, 0x9 } };

		}
	}
}

#endif // _SHARED_PLATFORM_IO_IFILESYSTEM_H_
